package Fail3_17;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

/**
 * 可以输出文字的方法
 */
public class FileDemo5 {
    public static void main(String[] args) {
        try (InputStream inputStream=new FileInputStream("./hello.txt")){
            try (Scanner scanner=new Scanner(inputStream,"utf-8")){
                while (scanner.hasNext()){
                    String s=scanner.next();
                    System.out.println(s);
                }
            }
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
